package presentation;

import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;

import control.CControl;

public class PSettings extends JPanel {
	private static final long serialVersionUID = 1L;

	public PSettings(CControl cControl) {
		this.setLayout(new BoxLayout(this,BoxLayout.PAGE_AXIS));
		this.setBackground(Color.white);
		
		Font plainFont = new Font("Arial",Font.PLAIN,14);
		JLabel spacing = new JLabel();
		spacing.setPreferredSize(new Dimension(1000,50));
		spacing.setMaximumSize(new Dimension(1000,50));
		spacing.setMinimumSize(new Dimension(1000,50));
		spacing.setAlignmentX(Component.CENTER_ALIGNMENT);
		
		JLabel disclaimer1 = new JLabel("The application needs to be " +
				"restated before any changes in the connection, window or " +
				"tire temp settings takes effect.",
				JLabel.CENTER);
		disclaimer1.setPreferredSize(new Dimension(1000,30));
		disclaimer1.setMaximumSize(new Dimension(1000,30));
		disclaimer1.setMinimumSize(new Dimension(1000,30));
		disclaimer1.setAlignmentX(Component.CENTER_ALIGNMENT);
		disclaimer1.setFont(plainFont);
		
		JLabel disclaimer2 = new JLabel("You can add maps by putting the " +
				"images in the /maps folder, and restarting the application.",
				JLabel.CENTER);
		disclaimer2.setPreferredSize(new Dimension(1000,30));
		disclaimer2.setMaximumSize(new Dimension(1000,30));
		disclaimer2.setMinimumSize(new Dimension(1000,30));
		disclaimer2.setAlignmentX(Component.CENTER_ALIGNMENT);
		disclaimer2.setFont(plainFont);
		
		this.add(Box.createVerticalGlue());
		this.add(new PSettingsForm(cControl));
		this.add(spacing);
		this.add(disclaimer1);
		this.add(disclaimer2);
		this.add(Box.createVerticalGlue());
	}
}
